/* 基础容器 */
.promotion-page {
  margin: 0 auto;
  padding: 12px;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: #f5f0eb;
  height: calc(100vh - 50px);
  overflow-y: auto;
}

/* 1. 收益统计 */
.income-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  gap: 15px;
}

.stat-card {
  background-color: white;
  padding: 15px;
  border-radius: 12px;
  /* 大圆角 */
  text-align: center;
  flex: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(141, 110, 99, 0.1);
}

.stat-title {
  font-size: 14px;
  color: #8d6e63;
  margin: 0 0 8px;
}

.stat-value {
  font-size: 20px;
  font-weight: bold;
  color: #5d4037;
  margin: 0 0 6px;
}

.stat-rate {
  font-size: 14px;
  color: #4caf50;
  margin: 0;
}

.up-arrow {
  color: #4caf50;
}

.settle-desc {
  font-size: 13px;
  color: #8d6e63;
  margin: 0;
}

/* 2. 推广链接 */
.promotion-link-section {
  margin-bottom: 15px;
  background-color: white;
  padding: 20px;
  border-radius: 12px;
  /* 大圆角 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.section-title {
  font-size: 18px;
  color: #5d4037;
  margin: 0 0 15px;
  font-weight: 600;
}

.link-container {
  display: flex;
  margin-bottom: 10px;
}

.promotion-link {
  flex: 1;
  padding: 10px;
  border: 1px solid #e0d8d0;
  border-radius: 8px 0 0 8px;
  /* 左圆角 */
  background-color: #fcfaf7;
  color: #5d4037;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.promotion-link:focus {
  border-color: #8d6e63;
}

.copy-btn {
  background-color: #8d6e63;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 0 8px 8px 0;
  /* 右圆角 */
  cursor: pointer;
  transition: background-color 0.3s, box-shadow 0.2s;
  font-size: 14px;
}

.copy-btn:hover {
  background-color: #795548;
  box-shadow: 0 2px 4px rgba(141, 110, 99, 0.2);
}

.copy-success {
  color: #4caf50;
  font-size: 14px;
  margin: 5px 0 15px;
}

/* 3. 功能按钮组 */
.share-buttons {
  display: flex;
  gap: 13px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: white;
  padding: 12px 8px;
  /* 增大内边距 */
  border-radius: 10px;
  /* 大圆角 */
  cursor: pointer;
  color: #5d4037;
  transition: all 0.3s;
  width: 85px;
  /* 加宽按钮 */
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.share-btn:hover {
  background-color: #efe6dd;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(141, 110, 99, 0.1);
}

.share-icon {
  width: 40px;
  /* 加大图标 */
  height: 40px;
  margin-bottom: 6px;
}

/* 图标配色（匹配参考图） */
.share-icon.copy {
  color: #f5a623;
  /* 橙色：复制链接 */
}

.share-icon.report {
  color: #42a5f5;
  /* 蓝色：数据报表 */
}

.share-icon.copywriting {
  color: #ec407a;
  /* 粉色：推广文案 */
}

.share-icon.poster {
  color: #7e57c2;
  /* 紫色：推广海报 */
}

.share-btn span {
  font-size: 13px;
}

/* 4. 收益排行榜 */
.income-ranking-section {
  background-color: white;
  padding: 20px;
  border-radius: 12px;
  /* 大圆角 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ranking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0d8d0;
}

.ranking-header h3 {
  font-size: 18px;
  color: #5d4037;
  margin: 0;
  font-weight: 600;
}

.update-time {
  font-size: 13px;
  color: #8d6e63;
  margin: 0;
  padding-top: 5px;
  margin-left: auto;
}

.ranking-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #f5f0eb;
  transition: background-color 0.2s ease;
}

.ranking-item:hover {
  background-color: #f9f2ed;
}

.ranking-item:last-child {
  border-bottom: none;
}

/* 排行徽章（匹配参考图配色） */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: white;
  font-weight: bold;
  font-size: 16px;
  margin-right: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 第1名：黄色 */
.ranking-item:nth-child(1) .rank-badge {
  background: #f5a623;
  border: 2px solid #ffc107;
}

/* 第2名：灰色 */
.ranking-item:nth-child(2) .rank-badge {
  background: #9e9e9e;
  border: 2px solid #e0e0e0;
}

/* 第3名：棕色 */
.ranking-item:nth-child(3) .rank-badge {
  background: #8d6e63;
  border: 2px solid #d7ccc8;
}

/* 4-5名：默认棕色 */
.ranking-item:nth-child(n + 4) .rank-badge {
  background-color: #8d6e63;
  color: white;
  border: 2px solid #d7ccc8;
}

.ranking-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 15px;
  object-fit: cover;
  border: 2px solid #f5f0eb;
}

/* 前三名头像加环（匹配参考图） */
.ranking-item:nth-child(1) .ranking-avatar {
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.2);
}

.ranking-item:nth-child(2) .ranking-avatar {
  box-shadow: 0 0 0 3px rgba(158, 158, 158, 0.2);
}

.ranking-item:nth-child(3) .ranking-avatar {
  box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.2);
}

.ranking-info {
  flex: 1;
}

.ranking-name {
  font-weight: 600;
  color: #5d4037;
  margin: 0 0 3px;
  font-size: 16px;
}

.ranking-order-count {
  font-size: 13px;
  color: #8d6e63;
  margin: 0;
}

.ranking-income {
  text-align: right;
  min-width: 120px;
}

.income-value {
  font-weight: 600;
  color: #d32f2f;
  /* 红色：收益数值 */
  margin: 0 0 3px;
  font-size: 16px;
}

.income-rate {
  font-size: 13px;
  color: #4caf50;
  margin: 0;
}

/* 5. 弹窗通用样式 */
.qr-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.qr-modal {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  width: 90%;
  height: 80%;
  overflow-y: auto;
}

.qr-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e0d8d0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qr-modal-header h3 {
  margin: 0;
  font-size: 17px;
  color: #5d4037;
}

.close-btn {
  border: none;
  background: transparent;
  font-size: 22px;
  color: #8d6e63;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: #795548;
}

.close-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.qr-modal-content {
  padding: 20px;
}

.qr-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #e0d8d0;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* 6. 海报弹窗样式 */
.poster-modal {
  width: 85%;
  max-width: 350px;
}

.tcm-poster {
  width: 280px;
  height: 360px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0d8d0;
  margin: 0 auto 20px;
  transition: transform 0.3s ease;
}

.tcm-poster:hover {
  transform: scale(1.02);
}

.poster-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.85);
}

.poster-qr {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background-color: #fff;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qr-tip {
  font-size: 13px;
  color: #5d4037;
  margin-top: 8px;
  text-align: center;
  font-weight: 500;
  margin-bottom: 0;
}

/* 7. 文案弹窗样式 */
.copy-modal {
  width: 85%;
  max-width: 500px;
}

.platform-select-group {
  display: flex;
  gap: 15px;
  justify-content: center;
  padding: 20px;
  border-bottom: 1px solid #e0d8d0;
  flex-wrap: wrap;
}

.platform-btn {
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid #8d6e63;
  background-color: white;
  color: #8d6e63;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s;
}

.platform-btn.active {
  background-color: #8d6e63;
  color: white;
  box-shadow: 0 2px 4px rgba(141, 110, 99, 0.2);
}

.platform-btn:hover:not(.active) {
  background-color: #f9f2ed;
}

.platform-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.copy-textarea {
  width: 100%;
  resize: none;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #e0d8d0;
  font-size: 14px;
  line-height: 1.6;
  box-sizing: border-box;
  min-height: 120px;
  margin-top: 10px;
  background-color: #fcfaf7;
  color: #5d4037;
  outline: none;
  transition: border-color 0.2s ease;
}

.copy-textarea:focus {
  border-color: #8d6e63;
}

/* 8. 数据报表弹窗样式（重点优化） */
.report-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.report-modal {
  background-color: white;
  border-radius: 16px;
  /* 大圆角增强柔和感 */
  box-shadow: 0 8px 24px rgba(141, 110, 99, 0.15);
  /* 分层阴影提升质感 */
  width: 90%;
  max-width: 640px;
  position: relative;
  /* 用于定位AI按钮 */
}

/* 弹窗头部：标题 + 关闭按钮 */
.report-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0e8e2;
  /* 浅分隔线 */
}

.report-modal-title {
  font-size: 22px;
  color: #5d4037;
  /* 深棕主文字色 */
  margin: 0;
  font-weight: 600;
}

.report-modal-close-btn {
  background: transparent;
  border: none;
  font-size: 28px;
  color: #8d6e63;
  /* 中棕次要文字色 */
  cursor: pointer;
  transition: color 0.2s ease;
}

.report-modal-close-btn:hover {
  color: #75584e;
  /* 深棕hover反馈 */
}

/* 日期范围切换按钮组 */
.date-range-group {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  /* 小屏自动换行 */
}

.date-range-btn {
  padding: 10px 20px;
  border: 1px solid #e0d8d0;
  /* 浅边框 */
  border-radius: 10px;
  /* 圆角与整体风格统一 */
  background-color: white;
  color: #5d4037;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  /* 防止文字换行 */
}

.date-range-btn.active {
  background-color: #8d6e63;
  /* 深棕激活态背景 */
  color: white;
  /* 白色激活态文字 */
  border-color: #8d6e63;
  box-shadow: 0 4px 8px rgba(141, 110, 99, 0.2);
  /* 激活态阴影突出 */
}

.date-range-btn:hover:not(.active) {
  border-color: #8d6e63;
  color: #8d6e63;
}

/* 统计卡片区域：三列横向排列 */
.report-stats {
  display: flex;
  justify-content: space-between;
  gap: 7px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.report-stat-card {
  flex: 1;
  min-width: calc(33.333% - 5px);
  padding: 15px;
  background-color: #f9f2ed;
  /* 柔和米色背景 */
  border-radius: 12px;
  box-shadow: 0 3px 6px rgba(141, 110, 99, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.report-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(141, 110, 99, 0.12);
}

.report-stat-label {
  margin: 0 0 10px;
  font-size: 13px;
  color: #8d6e63;
  /* 中棕标签色 */
}

.report-stat-value {
  margin: 0;
  color: #5d4037;
  font-weight: 600;
}

.report-stat-value.total-income {
  font-size: 20px;
  /* 总收益数值更大 */
  color: #d32f2f;
  /* 总收益用红色突出 */
}

/* 每日数据列表 */
.daily-data-list {
  margin-bottom: 28px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 8px;
}

.daily-data-list::-webkit-scrollbar {
  width: 6px;
}

.daily-data-list::-webkit-scrollbar-thumb {
  background-color: #d7ccc8;
  border-radius: 3px;
}

.daily-data-item {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #f0e8e2;
  transition: background-color 0.2s ease;
}

.daily-data-item:hover {
  background-color: #f9f2ed;
}

.daily-data-day {
  color: #5d4037;
  /* 深棕日期色 */
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.daily-data-day::before {
  content: "•";
  color: #8d6e63;
  font-size: 18px;
}

.daily-data-income {
  color: #8d6e63;
  /* 中棕收益色 */
  font-size: 16px;
  font-weight: 500;
}

/* 数据报表底部工具栏 */
.report-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid #f0e8e2;
  margin-bottom: 16px;
}

.export-btn {
  padding: 8px 16px;
  border: 1px solid #8d6e63;
  border-radius: 6px;
  background-color: #fff;
  color: #8d6e63;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.export-btn:hover {
  background-color: #f8f5f2;
  box-shadow: 0 2px 4px rgba(141, 110, 99, 0.1);
}

.data-summary {
  font-size: 14px;
  color: #8d6e63;
}


/* 9. 按钮通用样式 */
.save-qr-btn {
  padding: 8px 24px;
  border: none;
  border-radius: 8px;
  background-color: #8d6e63;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s;
  font-size: 14px;
}

.save-qr-btn:hover {
  background-color: #75584e;
  box-shadow: 0 2px 4px rgba(141, 110, 99, 0.2);
}

.save-qr-btn:disabled {
  background-color: #b8a59a;
  cursor: not-allowed;
}

/* 10. 加载动画样式 */
.ai-loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f0e8e2;
  border-top: 4px solid #8d6e63;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

.loading-text {
  color: #66544b;
  font-size: 14px;
  text-align: center;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}


@media (max-width: 400px) {
  .report-stat-card {
    min-width: 100%;
  }

  .share-btn {
    flex: 1 0 40%;
  }

  .tcm-poster {
    width: 240px;
    height: 380px;
  }

  .platform-select-group {
    flex-wrap: wrap;
  }

  .report-ai-btn {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
    font-size: 16px;
  }
}


.chart-container canvas {
  left: -10px !important;
  /* top: -30px !important; */
}